//
//  ChoiceViewController.m
//  torycoupon
//
//  Created by 이 민우 on 13. 4. 19..
//  Copyright (c) 2013년 manytory. All rights reserved.
//

#import "ChoiceViewController.h"
#import "LoginViewController.h"
#import "JoinViewController.h"
#import "ComData.h"

@interface ChoiceViewController ()

@end

@implementation ChoiceViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id) init {
    self = [super init];
    if(self != nil) {
        self.title = @"로그인/회원가입";
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    [self performSelector:@selector(initView)];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - user function

- (void)initView {
//    self.view.bounds.size.height  세로사이즈
//    self.view.bounds.size.width   가로사이즈
    
    btnJoinStart = [ComData AddRoundButton:self.view text:@"회원가입" setRect:CGRectMake(20.0, 310.0, self.view.bounds.size.width - 40.0, 50.0)];
    [btnJoinStart setCenter:CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height / 2 - 30.0)];
    [btnJoinStart addTarget:self action:@selector(joinButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    btnLoginStart = [ComData AddRoundButton:self.view text:@"로그인" setRect:CGRectMake(20.0, 310.0, self.view.bounds.size.width - 40.0, 50.0)];
    [btnLoginStart setCenter:CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height / 2 + 30.0)];
    [btnLoginStart addTarget:self action:@selector(loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}

- (IBAction)joinButtonAction:(id)sender {
//    NSLog(@"joinButtonAction");
    JoinViewController *viewCtrl = [[JoinViewController alloc] init];
//    viewCtrl.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:viewCtrl animated:YES];
    [viewCtrl release];
}

- (IBAction)loginButtonAction:(id)sender {
//    NSLog(@"loginButtonAction");
    LoginViewController *viewCtrl = [[LoginViewController alloc] init];
//    viewCtrl.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:viewCtrl animated:YES];
    [viewCtrl release];
}
@end
